<template>
	<view class="content">
		<u--image :showLoading="true" :src="src" width="750rpx" height="600rpx" @click="click"></u--image>
		<u-gap height="20rpx" bgColor="#f5f5f5"></u-gap>
		
		<view class="list" v-if="list.length>0">
			<view class="date">2021-12至202-09</view>
			
			<view class="item" v-for="(item,index) in list" :key="index">
				<image class="icon" src="../../static/img/tab_icon_1_active.png"></image>
				<view class="right">
					<text class="name">名称</text>
					<text class="value1">111</text>
					<text class="lable">用量</text>
					<text class="value2">111</text>
				</view>
			</view>
		</view>
			
		<view class="nodata" v-else>
			<image class="img_bg" src="../../static/img/nodata.png"></image>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				src: 'https://img2.baidu.com/it/u=2112311137,2912593221&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500',
				list:[{},{},{}]
			}
		},
		onLoad() {
			this.load_info()
		},
		methods: {
			nav_go(url) {
				console.log(url)
				this.$util.navTo(url)
			},
			load_info(){
				this.$http.req('get', "traceability/code/"+this.code, {}, this).then(res => {
					var data = res.data.data
					if (res.data.code == 200) {
						console.log(data)
					}
				})
			}
		}
	}
</script>

<style lang="less">
	.content {
		width: 750rpx;
		position: relative;
		display: flex;
		flex-direction: column;
		.list{
			margin-top: 10rpx;
			padding-top: 30rpx;
			border-radius: 20rpx;
			background-color: #fff;
			display: flex;
			flex-direction: column;
			
			.date{
				margin-left: 15rpx;
				width: 300rpx;
				line-height: 50rpx;
				text-align: center;
				background-color: #409a67;
				border-radius: 30rpx;
				color: #fff;
				font-size: 30rpx;
			}
			.item{
				border-left: 1px dotted #999;
				height: 190rpx;
				display: flex;
				flex-wrap: wrap;
				align-items: center;
				margin-left: 40rpx;
				position: relative;
				.icon{
					width: 50rpx;
					height: 50rpx;
					position: absolute;
					left: -20rpx;
					top: 55rpx;
					background-color: #fff;
				}
				.right{
					margin-bottom: 20rpx;
					width: 550rpx;
					border-radius: 20rpx;
					height: 150rpx;
					margin-left: 80rpx;  
					border: 1px solid #f2f2f2;
					border-right: 5px solid #3f9b63;
					position: relative;
					font-size: 30rpx;
					.name{
						position: absolute;
						left: 20rpx;
						top: 20rpx;
					}
					.value1{
						position: absolute;
						left: 160rpx;
						top: 20rpx;
					}
					.lable{
						position: absolute;
						left: 20rpx;
						top: 80rpx;
					}
					.value2{
						position: absolute;
						left: 160rpx;
						top: 80rpx;
					}
				}
			}
		}
		
		.nodata{
			width: 750rpx;
			height: 500rpx;
			background-color: #fff;
			border-radius: 20rpx;
			.img_bg{
				width: 400rpx;
				height: 350rpx;
				margin-left: 175rpx;
				margin-top: 50rpx;
			}
		}
		.ui_info{
			margin-bottom: 10rpx;
			display: flex;
			font-size: 28rpx;
			width: 610rpx;
			.right{
				color: #666;
			}
		}
		
	}
</style>
